package com.itheima.gui;

import javax.swing.*;
import java.awt.*;

public class Test4 {

    public static void main(String[] args) {

        //GridLayout 网格布局
        JFrame jf = new JFrame("GridLayout Example");
        jf.setSize(400,300);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        jf.setLayout(new GridLayout(2,3));

        jf.add(new JButton("Button 1"));
        jf.add(new JButton("Button 2"));
        jf.add(new JButton("Button 3"));
        jf.add(new JButton("Button 4"));
        jf.add(new JButton("Button 5"));
        jf.add(new JButton("Button 6"));

        jf.setVisible(true);

    }
}
